package demo;

import java.util.HashMap;
import java.util.Map;

public class DemoAntankTheatreOta4Ticket {
	private static String appkey = "xiaoguo_test";
	private static String secretcode = "PVskgA4NUfHgJ2hD";
	private static String urlPre = "http://anticket.lengliwh.com/theatre";

	private static DemoApi demo = null;
	static {
		demo = new DemoApi(urlPre, appkey, secretcode, "partnerKey");
	}

	public static void getAvailableStadiums() {
		demo.req("/partner/stadium/getStadiums.xhtml", new HashMap<>(0), DemoApi.WAY_JAVANET);
	}

	public static void getAvailableVenues(Long stadiumId) {
		Map<String, String> p = Maps.of("stadiumId", "" + stadiumId);
		demo.req("/partner/stadium/getVenues.xhtml", p, DemoApi.WAY_JAVANET);
	}

	public static void getAvailablePrograms(Long venueId) {
		Map<String, String> p = Maps.of("venueId", "" + venueId);
		demo.req("/partner/ticket/getAvailablePrograms.xhtml", p, DemoApi.WAY_JAVANET);
	}

	public static void getAvailableSchedules(Long programId) {
		Map<String, String> p = Maps.of("programId", "" + programId);
		demo.req("/partner/ticket/getAvailableSchedules.xhtml", p, DemoApi.WAY_JAVANET);
	}

	public static void getProgramAvailablePrices(Long programId) {
		Map<String, String> p = Maps.of("programId", "" + programId);
		demo.req("/partner/ticket/getProgramAvailablePrices.xhtml", p, DemoApi.WAY_HTTPCLIENT);
	}

	public static void main(String[] args) {
		getAvailablePrograms(null);
		getAvailableStadiums();
	}

}
